// ************************************************************************ //
// The types declared in this file were generated from data read from the
// WSDL File described below:
// WSDL     : http://10.25.119.26:8080/hello/services/HelloWorldService?WSDL
// Encoding : UTF-8
// Version  : 1.0
// (2011-8-13 23:40:43 - 1.33.2.5)
// ************************************************************************ //

unit HelloWorldService;

interface

uses InvokeRegistry, SOAPHTTPClient, Types, XSBuiltIns;

type

  // ************************************************************************ //
  // The following types, referred to in the WSDL document are not being represented
  // in this file. They are either aliases[@] of other types represented or were referred
  // to but never[!] declared in the document. The types from the latter category
  // typically map to predefined/known XML or Borland types; however, they could also 
  // indicate incorrect WSDL documents that failed to declare or import a schema type.
  // ************************************************************************ //
  // !:string          - "http://www.w3.org/2001/XMLSchema"



  // ************************************************************************ //
  // Namespace : http://webservice.fly2ky.org
  // transport : http://schemas.xmlsoap.org/soap/http
  // style     : document
  // binding   : HelloWorldServiceHttpBinding
  // service   : HelloWorldService
  // port      : HelloWorldServiceHttpPort
  // URL       : http://10.25.119.26:8080/hello/services/HelloWorldService
  // ************************************************************************ //
  HelloWorldServicePortType = interface(IInvokable)
  ['{96E931DD-C217-5DE2-B368-AC5A7BF53938}']
    function  getServerTime: WideString; stdcall;
    function  showGreetings(const in0: WideString): WideString; stdcall;
    function  getEncrypt(const in0: WideString; const in1: WideString): WideString; stdcall;
    function  getDecrypt(const in0: WideString; const in1: WideString): WideString; stdcall;
  end;

function GetHelloWorldServicePortType(UseWSDL: Boolean=System.False; Addr: string=''; HTTPRIO: THTTPRIO = nil): HelloWorldServicePortType;


implementation

function GetHelloWorldServicePortType(UseWSDL: Boolean; Addr: string; HTTPRIO: THTTPRIO): HelloWorldServicePortType;
const
  defWSDL = 'http://10.25.119.26:8080/hello/services/HelloWorldService?WSDL';
  defURL  = 'http://10.25.119.26:8080/hello/services/HelloWorldService';
  defSvc  = 'HelloWorldService';
  defPrt  = 'HelloWorldServiceHttpPort';
var
  RIO: THTTPRIO;
begin
  Result := nil;
  if (Addr = '') then
  begin
    if UseWSDL then
      Addr := defWSDL
    else
      Addr := defURL;
  end;
  if HTTPRIO = nil then
    RIO := THTTPRIO.Create(nil)
  else
    RIO := HTTPRIO;
  try
    Result := (RIO as HelloWorldServicePortType);
    if UseWSDL then
    begin
      RIO.WSDLLocation := Addr;
      RIO.Service := defSvc;
      RIO.Port := defPrt;
    end else
      RIO.URL := Addr;
  finally
    if (Result = nil) and (HTTPRIO = nil) then
      RIO.Free;
  end;
end;


initialization
  InvRegistry.RegisterInterface(TypeInfo(HelloWorldServicePortType), 'http://webservice.fly2ky.org', 'UTF-8');
  InvRegistry.RegisterDefaultSOAPAction(TypeInfo(HelloWorldServicePortType), '');
  InvRegistry.RegisterInvokeOptions(TypeInfo(HelloWorldServicePortType), ioDocument);
  InvRegistry.RegisterExternalParamName(TypeInfo(HelloWorldServicePortType), 'getServerTime', 'out_', 'out');
  InvRegistry.RegisterExternalParamName(TypeInfo(HelloWorldServicePortType), 'showGreetings', 'out_', 'out');
  InvRegistry.RegisterExternalParamName(TypeInfo(HelloWorldServicePortType), 'getEncrypt', 'out_', 'out');
  InvRegistry.RegisterExternalParamName(TypeInfo(HelloWorldServicePortType), 'getDecrypt', 'out_', 'out');

end. 